<?php
require('config.php');
		$time=time();
        $t1=strtotime(date('Y-m-d 00:00:00',$time));
        $t2=strtotime(date('Y-m-d 08:00:00',$time));
        $t3=strtotime(date('Y-m-d 12:00:00',$time));
        $t4=strtotime(date('Y-m-d 16:00:00',$time));
        $t5=strtotime(date('Y-m-d 20:00:00',$time));
        $t6=strtotime(date('Y-m-d 24:00:00',$time));
        $data[0]['pan']=-1;
		if($time<$t2 && $time>=$t1)
		{
			$data[0]['pan']=1;
			$data[0]['end_time']=$t2;
		}
		if($time<$t3 && $time>=$t2)
		{
			$data[0]['pan']=2;
			$data[0]['end_time']=$t3;
		}
		if($time<$t4 && $time>=$t3)
		{
			$data[0]['pan']=3;
			$data[0]['end_time']=$t4;
		}
		if($time<$t5 && $time>=$t4)
		{
			$data[0]['pan']=4;
			$data[0]['end_time']=$t5;
		}
		if($time<$t6 && $time>=$t5)
		{
			$data[0]['pan']=5;
			$data[0]['end_time']=$t6;
		}
		$data[0]['time']=$time;
		echo json_encode($data);
?>